package com.testpro.abs;

import com.testpro.bean.svnLogDetiles;
import com.testpro.easyrest.Util.ExcelUtil;
import com.testpro.interfaces.logAnalys;

import java.io.File;
import java.io.FileNotFoundException;
import java.util.List;

/**
 * @author HelloWord testdevops
 * @description 抽象类 抽象分析日志过程
 * @create 2019-06-06 12:11
 */
public abstract class AbctactSVNLogAnalys implements logAnalys {

  private String filename;

  private String startDate;
  private String endDate;

  private String url;
  private String username;
  private String password;

  public void loganalysing() {

    initConfig();
    List<svnLogDetiles> list = checkLogsAnasy(startDate, endDate, url, username, password);
    try {
      new ExcelUtil().WriterExcelWithListBean(new File(filename), list, svnLogDetiles.class);
    } catch (FileNotFoundException e) {
      e.printStackTrace();
    }
  }

  protected abstract List<svnLogDetiles> checkLogsAnasy(
      String startDate, String endDate, String url, String username, String password);

  protected abstract void initConfig();

  public String getFilename() {
    return filename;
  }

  public void setFilename(String filename) {
    this.filename = filename;
  }

  public String getStartDate() {
    return startDate;
  }

  public void setStartDate(String startDate) {
    this.startDate = startDate;
  }

  public String getEndDate() {
    return endDate;
  }

  public void setEndDate(String endDate) {
    this.endDate = endDate;
  }

  public String getUrl() {
    return url;
  }

  public void setUrl(String url) {
    this.url = url;
  }

  public String getUsername() {
    return username;
  }

  public void setUsername(String username) {
    this.username = username;
  }

  public String getPassword() {
    return password;
  }

  public void setPassword(String password) {
    this.password = password;
  }
}
